rnings("static-access")   
	    public static void main(String []args) {   
	        //直接使用 类名.静态方法名()   
	        System.out.println("TestStatic.staticValue");   
	        Quan1.setStaticValue("static value");   
	           
	        Quan1 t1 = new Quan1();   
	        Quan1 t2 = new Quan1();   
	  
	        //t1, t2存取到的值应该是一样的   
	        System.out.println("from t1:staticValue=" + t1.getStaticValue());   
	        System.out.println("from t2:staticValue=" + t2.getStaticValue());   
	        //通过对象t1改变static变量   
	        System.out.println("t1.staticValue");   
	        t1.setStaticValue("t1");   
	        //t1, t2存取到的值应该是一样的   
	        System.out.println("from t1:staticValue=" + t1.getStaticValue());   
	        System.out.println("from t2:staticValue=" + t2.getStaticValue());   
	  
	        //通过对象t2改变static变量   
	        System.out.println("t2.staticValue");   
	        t2.setStaticValue("t2");   
	        //t1 受到影响   
	        System.out.println("from t1:staticValue=" + t1.getStaticValue());   
	    }   
	       
	    public static String getStaticValue() {   
	        return staticValue;   
	    }   
	       
	    public static void setStaticValue(String staticValue) {   
	        //直接通过 类名.静态变量 存取   
	    	Quan1.staticValue = staticValue;   
	    }   
	       
	    public String accessStaticValue () {   
	        value = staticValue;    //普通的方法可以存取static 方法或 static变量   
	           
	        return staticValue;   
	    }   
	}  


A
A
B
B
B
B
B
B
A
A
A
A
A
A
A
A
A
A
A
A

A
A
A
A
A
A
A
A
B
B
B
B
B
B
A
A
A

